/*
 * *******************************************************************
 *   @项目名称: BHex Android
 *   @文件名称: BindInfoActivity.java
 *   @Date: 19-5-21 下午7:37
 *   @Author: ppzhao
 *   @Description:
 *   @Copyright（C）: 2019 BlueHelix Inc.   All rights reserved.
 *   注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的.
 *  *******************************************************************
 */

package io.bhex.app.account.ui;

import android.content.Intent;
import android.text.TextUtils;

import io.bhex.app.R;
import io.bhex.app.account.presenter.BindInfoPresenter;
import io.bhex.app.base.BaseActivity;
import io.bhex.app.view.TopBar;

public class BindInfoActivity extends BaseActivity<BindInfoPresenter,BindInfoPresenter.BindInfoUI> implements BindInfoPresenter.BindInfoUI {
    private TopBar topBar;

    @Override
    protected int getContentView() {
        return R.layout.activity_bind_info_layout;
    }

    @Override
    protected BindInfoPresenter createPresenter() {
        return new BindInfoPresenter();
    }

    @Override
    protected BindInfoPresenter.BindInfoUI getUI() {
        return this;
    }

    @Override
    protected void initView() {
        super.initView();
        topBar = viewFinder.find(R.id.topBar);
        this.setTopbarNight(topBar);
        Intent intent = getIntent();
        if (intent != null) {
            String bindType = intent.getStringExtra("bindType");
            if (!TextUtils.isEmpty(bindType)) {
                if (bindType.equals("email")) {
                    topBar.setTitle(getString(R.string.string_email));
                    viewFinder.textView(R.id.bind_type).setText(getString(R.string.string_email));
                } else if(bindType.equals("mobile")) {
                    topBar.setTitle(getString(R.string.string_mobile_number));
                    viewFinder.textView(R.id.bind_type).setText(getString(R.string.string_mobile_number));
                }

            }

            String bindInfo = intent.getStringExtra("bindInfo");
            if (!TextUtils.isEmpty(bindInfo)) {
                viewFinder.textView(R.id.bind_info).setText(bindInfo);
            }
        }

    }
}
